#pragma once
#include "Runtime/BattleFirePrefix.h"
namespace Alice
{
    enum class EThreadPriority
    {
        TPri_Normal,
        TPri_AboveNormal,
        TPri_BelowNormal,
        TPri_Highest,
        TPri_Lowest,
        TPri_SlightlyBelowNormal,
        TPri_TimeCritical,
        TPri_Num,
    };
    enum class ENamedThreads : int32
    {
        UnusedAnchor = -1,
        RHIThread,
        AudioThread,
        GameThread,
        // The render thread is sometimes the game thread and is sometimes the actual rendering thread
        ActualRenderingThread = GameThread + 1,
        // CAUTION ThreadedRenderingThread must be the last named thread, insert new named threads before it
        /** not actually a thread index. Means "Unknown Thread" or "Any Unnamed Thread" **/
        AnyThread = 0xff, 
        /** High bits are used for a queue index and priority**/
        MainQueue =			0x000,
        LocalQueue =		0x100,

        NumQueues =			2,
        ThreadIndexMask =	0xff,
        QueueIndexMask =	0x100,
        QueueIndexShift =	8,
        /** High bits are used for a queue index task priority and thread priority**/

        NormalTaskPriority =	0x000,
        HighTaskPriority =		0x200,

        NumTaskPriorities =		2,
        TaskPriorityMask =		0x200,
        TaskPriorityShift =		9,

        NormalThreadPriority = 0x000,
        HighThreadPriority = 0x400,
        BackgroundThreadPriority = 0x800,

        NumThreadPriorities = 3,
        ThreadPriorityMask = 0xC00,
        ThreadPriorityShift = 10,

        /** Combinations **/
        GameThread_Local = GameThread | LocalQueue,
        ActualRenderingThread_Local = ActualRenderingThread | LocalQueue,

        AnyHiPriThreadNormalTask = AnyThread | HighThreadPriority | NormalTaskPriority,
        AnyHiPriThreadHiPriTask = AnyThread | HighThreadPriority | HighTaskPriority,

        AnyNormalThreadNormalTask = AnyThread | NormalThreadPriority | NormalTaskPriority,
        AnyNormalThreadHiPriTask = AnyThread | NormalThreadPriority | HighTaskPriority,

        AnyBackgroundThreadNormalTask = AnyThread | BackgroundThreadPriority | NormalTaskPriority,
        AnyBackgroundHiPriTask = AnyThread | BackgroundThreadPriority | HighTaskPriority,
    };
}